#ifndef PURG_SHA1_STREAM_H
#define PURG_SHA1_STREAM_H

#include "polar_ssl_sha1.h"
#include "buffer.h"


#ifndef PURG_C_INTERFACE_COMPILE
namespace purg
{
#endif

  class sha1_stream
  {
    public:

      enum { buffer_length = 20 };
      typedef  unsigned int   seed;

      class  sha_state 
      {
        public:
          int     _length;
          buffer *_buffer;
          int    *_seed_ptr;
          size_t *_id;
          size_t *_iteration;

          void   add_data ( buffer & , seed & , size_t );
          void   hash ();
      };
      
      typedef  sha_state   state;

      static void  initialize ( state & , buffer & , seed & , size_t );
      static void  update_buffer ( state & , buffer & ); 

      static void  lock ( state & ) {}
      static void  unlock ( state & ) {}
  };

#ifndef PURG_C_INTERFACE_COMPILE
}
#endif

#include "sha1_stream.inline.h"

#endif
